package net.mxox.app.financeweb.action;

import com.opensymphony.xwork2.ModelDriven;

import net.mxox.app.common.BaseAction;
import net.mxox.app.financeweb.bo.impl.AccountManager;
import net.mxox.app.financeweb.dto.Account;

public class CreateAccountAction extends BaseAction implements ModelDriven<Account>{
	
	private static final long serialVersionUID = 1L;

	private Account model;
	
	private AccountManager accountManager;

	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}
	
	public String create() {
		accountManager.createAccount(model);
		return "res1";
	}
	
	public Account getModel() {
		if(model==null) {
			model=new Account();
		}
		return model;
	}

	public void setAccountManager(AccountManager accountManager) {
		this.accountManager = accountManager;
	}
}
